package string;

public class Demo04 {
    public static final String S = "ABC";
    public static void main(String[] args) {
        String s1 = "ABC";
        String s2 = "ABC";
        System.out.println(s1==s2);

        String s3 = new String("ABC");
        System.out.println(s1==s3);

        System.out.println(S==s1);


        String s4 = "AB"+"C";

        String s6 = "AB";
        String s7 = "C";
        String s8 = s6+s7;
        System.out.println(s1 == s4);
        System.out.println(s8);
        System.out.println(s1 == s8);
    }
}
